package com.example.bcscb.config.MultipleDataSourcesConfig;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @author bc
 * @Description: 继承Spring AbstractRoutingDataSource实现路由切换
 * @date 2024/03/08
 */
public class DynamicDataSource extends AbstractRoutingDataSource {

    @Override
    protected Object determineCurrentLookupKey() {
        return DynamicDataSourceContextHolder.getDataSourceType();
    }
}
